The statements in this section merely provide background information related to the present disclosure and may not constitute the prior art.
In general, one picture is divided into a plurality of macro blocks and then each of the macro blocks is encoded using an inter prediction and an intra prediction in order to encode an image in image compressing methods such as MPEG-2 (Moving Picture Experts Group-2), MPEG-4, and H.264/AVC (Advanced Video Coding).
The intra prediction efficiently removes spatial redundancy through performing an encoding with reference to a value of a physically adjacent pixel to a block to be encoded within a current picture. First, a prediction value for a current block to be encoded is calculated using the value of the adjacent pixel. Next, the difference between the prediction value and a pixel value of the current block is encoded through a DCT (Discrete Cosine Transform) and a quantization. Here, there are various intra prediction modes to predict the pixel value of the current block, and the modes are largely divided into a 4×4 intra prediction mode, an 8×8 intra prediction mode, a 16×16 intra prediction mode by a luminance component, and an intra prediction mode by a chrominance component.
FIGS. 1 and 2 illustrate the 4×4 intra prediction mode of H.264/AVC. FIG. 1 illustrates nine prediction modes for the 4×4 intra prediction and FIG. 2 illustrates eight directions of the 4×4 intra prediction mode.
Referring to FIG. 1, the 4×4 intra prediction mode has nine prediction modes which sequentially include a vertical mode, a horizontal mode, a direct current (DC) mode, a diagonal down-left mode, a diagonal down-right mode, a vertical-right mode, a horizontal-down mode, a vertical-left mode and a horizontal-up mode. Each of the nine intra prediction modes has one of mode numbers 0 to 8 according to its statistically used frequency. The vertical mode having a mode number “0” is most frequently used and the horizontal-up mode having a mode number “8” is least frequently used statistically.
Referring to FIG. 2, the nine 4×4 intra prediction modes perform an intra prediction in eight directions, respectively, except for the DC mode having no directivity.
Similar to the 4×4 intra prediction mode, the 8×8 intra prediction mode and the 16×16 intra prediction mode include four prediction modes. In an apparatus for encoding the intra prediction mode of H.264/AVC, all of the 4×4 intra prediction mode, the 8×8 intra prediction mode, and the 16×16 intra prediction mode are performed, an optimal mode is selected taking account into RD (Rate-Distortion) costs of a block to be encoded, and then a bitstream is generated.
In order to decode a bitstream encoded by the intra prediction, a receiving side should know information on the intra prediction mode. Accordingly, information on an intra prediction direction is inserted in the bitstream as well as the difference between an intra prediction value and a pixel value of a current block and the bitstream is transmitted. Since the correlation between a prediction direction of the current block and a prediction direction of an adjacent block is high due to the spatial redundancy of an image, the intra prediction direction of the current block is encoded with reference to an intra prediction direction of the adjacent block.
A method of encoding an intra prediction direction according to conventional arts will be described with reference to drawings in more detail.
FIGS. 3 and 4 illustrate a method of encoding and decoding a 4×4 intra prediction direction in the H.264.AVC. FIG. 3 illustrates orders of an intra prediction encoding and an intra prediction decoding of a 4×4 block and FIG. 4 illustrates positions of a current block and adjacent blocks.
Referring to FIG. 3, a macro block having a size of 16×16 is divided into sixteen blocks having a size of 4×4 and an intra prediction encoding is performed according to an order of blocks 0 to 15 in the H.264/AVC. A receiving side also decodes a block to be decoded according to an order of blocks 0 to 15 like the encoding order. If the encoding and the decoding are performed according to the order of blocks 0 to 15, it is possible to refer to an intra prediction direction or a pixel value of a block in which the decoding is completed among adjacent blocks when the receiving side decodes a current block.
Referring to FIG. 4, information on the intra prediction direction of the current block 400 is encoded with reference to intra prediction directions of an upper block 410 located in an upper portion of the current block 400 and a left block 420 located in a left portion of the current block 400 in the H.264/AVC. Each of the upper block 410 and the left block 420 have the information on the intra prediction direction because they are encoded before the current block 400 is encoded, and the receiving side can refer to the information on the intra prediction direction because the upper block 410 and the left block 420 are decoded before the current block 400 is decoded.
First, a prediction mode number of the current block 400 is determined by RD costs. Next, a minimum value of intra prediction mode numbers of the upper block 410 and the left block 420 is defined as an MPM (Most Probable Mode) and the MPM is compared with the intra prediction mode number of the current block 400. The intra prediction mode numbers include numbers 0 to 8 allocated according to the number of times of use in the statics, so that there is a high probability in which a minimum value of intra prediction mode numbers of adjacent blocks corresponds to the prediction mode number of the current block.
When the intra prediction mode number of the current block 400 corresponds to the MPM, an intra prediction direction of the current block 400 is encoded as “1” indicating that the intra prediction mode number of the current block 400 corresponds to the MPM and “1” is inserted in a bitstream to be transmitted. Since there is a high probability in which the intra prediction mode of the current block 400 corresponds to the MPM, the information on the intra prediction direction of the current block is more likely to be expressed by “1” and accordingly an information depression is performed. The receiving side can obtain the MPM with reference to the intra prediction mode numbers of the upper block 410 and the left block 420 although the intra prediction direction of the current block 400 is not directly transmitted, so that it is possible to perform a decoding in an intra prediction direction pointed by the MPM.
In contrast, when the intra prediction mode number of the current block 400 does not correspond to the MPM, the intra prediction direction of the current is block is encoded as “0” indicating that the intra prediction mode number of the current block 400 does not correspond to the MPM and “0” is first inserted in a bitstream. Next, the remaining eight intra prediction modes except for the MPM among the nine 4×4 intra predication modes are discriminated by binary numbers having a 3 bit size, and “XXX” corresponding to the intra prediction mode number of the current block 400 is inserted in a bitstream to be transmitted. Accordingly, the information on the intra prediction direction of the current block 400 is expressed by a total of 4 bits.
In the intra prediction mode encoding of the H.264/AVC, information is compressed only when the intra prediction mode number of the current block corresponds to the MPM and the information is not compressed at all when the intra prediction mode number of the current block does not correspond to the MPM. There are conventional technologies to solve the above mentioned problem, and the technologies intend to obtain the higher compression efficiency by newly defining an MPM having the higher reliability. In “efficient encoding technique for 4×4 intra prediction modes using the statistical distribution of intra modes of adjacent intra blocks” disclosed in Journal of Korea Contents Association, Vol. 9, No. 4, pp. 12-18, 2009 by Jae-Min Kim and Hyun-Soo Kang, a histogram to which weights of intra prediction modes are added is constructed for adjacent 4×4 blocks in which an encoding is already completed and a prediction mode having a larger value in the histogram among intra prediction modes of the upper block 410 and the left block 420 is determined as the MPM for the current block. The encoding technique can determine a more exact MPM with reference to the larger number of adjacent blocks. However, the encoding technique has disadvantages of increasing an amount of calculations and rather decreasing the accuracy of the MPM when adjacent blocks in excessively wide areas are referred in a complex image.
There is a conventional technology to determine the MPM more to adaptively according to an image structure without highly increasing an amount of calculations. In “A new method for estimating intra prediction mode in H.264/AVC”, IEICE Trans. Fundamentals, Vol. E91-A, No. 6, pp. 1529-1532, June 2008, by Dae-Yeon Kim, Dong-Kyun Kim, and Yung-Lyul Lee, the MPM is determined with reference to four adjacent blocks including an upper block, a left block, a left upper block, and a right upper block. Further, the nine 4×4 intra prediction modes are divided into a vertical mode group, a horizontal mode group, a diagonal down-left mode group, and a diagonal down-right mode group, and then the MPM is determined according to a kind of groups including intra prediction modes of adjacent blocks. The method can determine a suitable MPM for a structure around the current block by using a fact that an intra prediction mode of each block expresses the directivity of an edge existing in a corresponding block. However, the method cannot solve a basic problem in which information is not compressed at all when the intra prediction mode of the current block does not correspond to the determined MPM.
Accordingly, a method and an apparatus for encoding the intra prediction mode are required to compress intra prediction information for the current block by more efficiently using the similarity included in adjacent blocks within a screen in comparison with the conventional art.